import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/register',
    name: '注册',
    component: () => import('../views/Register.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  
  {
    path: '/login',
    name: '登录',
    component: () => import('../views/Login.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },

  {
    path: '/zone',
    name: '个人空间',
    component: () => import('../views/Zone.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  {
    path: '/about',
    name: '关于我们',
    component: () => import('../views/About.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  {
    path: '/setup',
    name: '个人设置',
    component: () => import('../views/Setup.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  {
    path: '/my',
    name: '我的',
    component: () => import('../views/my.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
    
  },
  // 分类
  {
    path: '/ranking',
    name: 'ranking',
    component: () => import('../views/Ranking.vue'),
  },
  // 规则
  {
    path: '/rankexplain',
    name: 'rankexplain',
    component: () => import('../views/Rankexplain.vue'),
  },
  {
    path: '/bookslist',
    name: '书单',
    component: () => import('../views/BooksList.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  {
    path: '/bookscon',
    name: '文本',
    component: () => import('../views/BooksCon.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  {
    path: '/author',
    name: '作者',
    component: () => import('../views/Author.vue'),
  },
  {
    path: '/details',
    name: '详情页',
    component: () => import('../views/Details.vue'),
  },
  {
    path: '/search',
    name: '搜索页面',
    component: () => import('../views/Search.vue'),
    meta: {
      hideHeader: true,  //  自定义属性， 代表隐藏footer    
    },
  },
  {
    path: '/index',
    name: '首页',
    component: () => import('../views/Index.vue'),
  },
  {
    path: '/',
    name: 'home',
    component: Index
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
